package com.my12306.user.dao.auth;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.my12306.user.model.po.auth.UserRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author:苏牧夕
 * @Date:2020/5/20 0:28
 * @Version 1.0
 */
@Mapper
public interface UserRoleDao extends BaseMapper<UserRoleEntity> {
    boolean saveBatchUserRole(List<UserRoleEntity> list);

    /**
     * 根据用户id 批量生产
     *
     * @param list
     * @return
     */
    boolean deleteUserRoleByUserIds(List<Long> list);

    /**
     * 根据角色id,批量生产
     *
     * @param ids
     * @return
     */
    boolean deleteBatchUserRoleByRoleIds(List<Long> ids);

    String queryRoleByUserId(@Param("userId") Long userId);
}
